package 华为练习;

import java.util.Scanner;

/**
 * Created by hest0 on 2017/7/12.
 */
public class 第一个出现一次的字符 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String line = sc.nextLine();
            System.out.println(func(line));
        }
        sc.close();
    }

    private static String func(String line) {
        for (int i = 0; i < line.length(); i++) {
            StringBuilder sb = new StringBuilder(line);
            char c = line.charAt(i);
            String cs = String.valueOf(c);
            StringBuilder tmp = sb.deleteCharAt(i);
            int idx = tmp.indexOf(cs);
            if (idx == -1) {
                return cs;
            }
        }
        return "-1";
    }

}
